﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Web;
//using MySql.Data.MySqlClient;

//namespace TCG.Helper
//{
//    public class ConnectionObject : IDisposable
//    {
//        private MySqlConnection Connection { get; set; }

//        public static ConnectionObject GetConnection()
//        {
//            MySqlConnectionStringBuilder csb = new MySqlConnectionStringBuilder();
//            csb.Server = "localhost";
//            csb.Database = "tcg";
//            csb.UserID = "root";
//            ConnectionObject con = new ConnectionObject();
//            con.Connection = new MySqlConnection(csb.ConnectionString);
//            if (con.Connection.State != System.Data.ConnectionState.Open)
//            {
//                con.Connection.Open();
//            }
//            return con;
//        }

//        void IDisposable.Dispose()
//        {
//            Connection.Close();
//            Connection = null;
//        }
//    }
//}